<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>Untitled Document</title>
    </head>
    <?php
    include("Koneksi.php");

    $Tanggal_Masuk = $_POST['Tanggal_Masuk'];
    if ($_POST['Jenis_Aqua'] == "Aqua Gelas") {
        $Jumlah_Aqua = "Jml_Aqua_Gelas";
        $Kode_Barang = "AG";
        $A = $_POST['Jumlah'];
    } else if ($_POST['Jenis_Aqua'] == "Aqua Botol Kecil") {
        $Jumlah_Aqua = "Jml_Aqua_Botol_Kecil";
        $Kode_Barang = "ABK";
        $A = $_POST['Jumlah'];
    } else if ($_POST['Jenis_Aqua'] == "Aqua Botol Sedang") {
        $Jumlah_Aqua = "Jml_Aqua_Botol_Sedang";
        $Kode_Barang = "ABS";
        $A = $_POST['Jumlah'];
    } else if ($_POST['Jenis_Aqua'] == "Aqua Botol Besar") {
        $Jumlah_Aqua = "Jml_Aqua_Botol_Besar";
        $Kode_Barang = "ABB";
        $A = $_POST['Jumlah'];
    } else if ($_POST['Jenis_Aqua'] == "Aqua Galon") {
        $Kode_Barang = "AG2";
        $Jumlah_Aqua = "Jml_Aqua_Galon";
        $A = $_POST['Jumlah'];
    } else {
        
    }

    $q = "INSERT INTO Barang (Kode_Barang,Tanggal_Masuk,$Jumlah_Aqua) VALUES ('$Kode_Barang',to_date('$Tanggal_Masuk','dd-mon-yyyy'),$A)";
    $rs = oci_parse($conn, $q);
    oci_execute($rs);
    if ($rs) {
        ?>
        <html>
            <title></title>
            <head>
                <body>
                    <center><h1>DATA BERHASIL DISIMPAN</h1>
                        <form action="FormTerimaBarang.php" method="post">
                            <input type="submit" value="OK" />
                        </form></center>
                </body>
            </head>
        </html>
        <?php
    } else {
        ?>
        <html>
            <title></title>
            <head>
                <body>
                    <center><h1>DATA GAGAL DISIMPAN</h1>
                        <form action="FormTerimaBarang.php" method="post">
                            <input type="submit" value="OK" />
                        </form></center>
                </body>
            </head>
        </html>
        <?php
    }
    ?>

    <body>
    </body>
</html>